<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Bootstrap CSS-->
    <%@include file="../assets/public.jsp"%>
    <title>文章详情</title>
    <style>
        .myList li{
            display: inline-block;
        }
    </style>
</head>
<body>
<%@include file="../assets/header.jsp"%>

<div class="d-flex align-items-stretch">
    <!-- Sidebar Navigation-->
    <%@include file="../assets/sidebar.jsp"%>
    <!-- Sidebar Navigation end-->
    <div class="page-content">
        <div class="page-header">
            <div class="container-fluid">
                <h2 class="h5 no-margin-bottom">文章详情</h2>
            </div>
        </div>

        <section class="no-padding-bottom">

            <div class="myTitle">
                <h3 class="text-center">${sessionScope.article.title}</h3>
                <c:if test="${sessionScope.IsfavArticle =='yes'}">
                    <input id="fav" type="button" data-artId="${sessionScope.article.id}" value="取消收藏" class="btn btn-info">
                </c:if>
                <c:if test="${sessionScope.IsfavArticle =='no'}">
                    <input id="fav" type="button" data-artId="${sessionScope.article.id}" value="收藏" class="btn btn-info">
                </c:if>

            </div>

            <div class="myContent">
                <p class="h6"><strong>发布人：</strong>${sessionScope.article.publishRealName}</p>
                <p class="h6"><strong>创建时间：</strong>${sessionScope.article.publishDate}</p>
                <p class="h6"><strong>浏览次数：</strong>${sessionScope.article.browseCount}</p>
                <p class="h6"><strong>收藏次数：</strong>${sessionScope.favCount}</p>
                <textarea style="padding: 2px" disabled="disabled" class="form-control" rows="11">
                    ${sessionScope.article.content}
                </textarea>

            </div>

            <div class="myList">
                <p>您关注的小伙伴等人也收藏了该文章</p>
                <ul>
                    <c:forEach var="user" items="${sessionScope.favArtUsers}">
                        <li class="list-group-item">
                            <c:if test="${user.realName== '' || user.realName == null}">
                                <a href="${pageContext.request.contextPath}/user/user_detail?uId=${user.id}">${user.username}</a>
                            </c:if>
                            <c:if test="${user.realName != '' && user.realName != null}">
                                <a href="${pageContext.request.contextPath}/user/user_detail?uId=${user.id}">${user.realName}</a>
                            </c:if>
                        </li>
                    </c:forEach>
                </ul>
            </div>
        </section>

        <%@include file="../assets/footer.jsp"%>
    </div>
</div>

</body>
</html>